{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "根据Bilibili UP@IT私塾 课程记录学习，更多详情看[这里](https://www.bilibili.com/video/BV1yY4y1w7r8?p=1&vd_source=9133539af302d5d54446b467fe568b43)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Python基础操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "type()\t#查看变量类型\n",
    "\n",
    "a, b, c = 1, 1000, 'hello'\t#多变量赋值\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "我20岁, 是中国人\n",
      "我20岁，是中国人\n",
      "世界,你好,世界\n",
      "姓名:张三,年龄:20\n",
      "姓名:张三,年龄:20\n",
      "姓名：kailailiu, 入学年份：2021, 学校：hrbmu\n"
     ]
    }
   ],
   "source": [
    "age = 20\n",
    "country = \"中国\"\n",
    "print(\"我%d岁, 是%s人\"%(age,country))  # %d是数字占位符(data), %s是字符占位(string)……还有很多 \n",
    "print(\"我{}岁，是{}人\".format(age,country))  # 用.连接\n",
    "print(\"{1},{0},{1}\".format(\"你好\",\"世界\"))  # 前方可以输入数字表示索引\n",
    "print(\"姓名:{name},年龄:{age}\".format(age = 20,name = \"张三\"))  # 可以定义索引\n",
    "info = {\"name\":\"张三\",\"age\":20}\n",
    "print(\"姓名:{name},年龄:{age}\".format(**info))  #用字典也能\n",
    "list = [\"kailailiu\",\"hrbmu\"]  #中括号列表，大括号字典\n",
    "print(\"姓名：{0[0]}, 入学年份：{1}, 学校：{0[1]}\".format(list,2021)) # 列表用中括号指示元素"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.5 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.5"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "f173e458ab3f47f421c59e3d2e9ecbcb39708ac58aaa54dabeb77e23953ff65a"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
